home *** CD-ROM | disk | FTP | other *** search
/ DarkBASIC - The Ultimate 3D Game Creator / PCactive 8 CD1 - DarkBasic.iso / SOFTWARE / DEMOS / DarkForge2000 / snippets_vol2 / snip_boxout.dba < prev    next >
Encoding:
Text File  |  2000-08-20  |  1.2 KB  |  74 lines

  1. `    ------------------------------------------------------------------------
  2. `    BoxOut Routine                             DarkForge Snippet (20/8/2000)
  3. `    ------------------------------------------------------------------------
  4. `    Just another (quite nice) way to wipe the current screen away.
  5.  
  6. sync rate 0
  7. sync on
  8. hide mouse
  9.  
  10. load bitmap "anhk_inside.bmp",1
  11. create bitmap 2,640,480
  12. copy bitmap 1,2
  13.  
  14. ink rgb(0,0,0),0
  15.  
  16. `    Some good combinations are (uncomment one to see it in action):
  17.  
  18.     w=64 : h=16 : speed=25
  19. `    w=639 : h=16 : speed=25
  20. `    w=32 : h=32 : speed=25
  21. `    w=320 : h=32 : speed=15
  22. `    w=32 : h=48 : speed=25
  23.  
  24. bx=0 : by=0 : bys=1 : ot=timer() : d=0
  25.  
  26. do
  27.  
  28.     set current bitmap 2
  29.  
  30.     by=0
  31.  
  32.     if d=0
  33.  
  34.         for b=0 to 479
  35.             for a=0 to 639 step w*2
  36.                 box a,by,a+w,by+bys
  37.             next a
  38.             inc by,h
  39.         next b
  40.  
  41.     else
  42.  
  43.         for b=0 to 479
  44.             for a=w to 639 step w*2
  45.                 if a+w>639
  46.                     box a,by,639,by+bys
  47.                 else
  48.                     box a,by,a+w,by+bys
  49.                 endif
  50.             next a
  51.             inc by,h
  52.         next b
  53.  
  54.     endif
  55.  
  56.     set current bitmap 0
  57.     copy bitmap 2,0
  58.     sync
  59.  
  60.     if timer()>ot+speed
  61.         ot=timer()
  62.         inc bys
  63.         if bys=h
  64.             inc d
  65.             bys=1
  66.         endif
  67.  
  68.         if d=2 then end
  69.  
  70.     endif
  71.  
  72. loop
  73.  
  74.